const http=require('http')
http.createServer((req,res)=>{
    console.log(req.url);
    const url=require('url')
    //定义一个网址变量
    var k='www.7k7k.com?name=biubui&age=20';
    //console.log(url.parse(k,true));
    console.log(req.url)//获取游览器访问的地址
    if(req.url!='/favicon.ico'){
    var user=url.parse(req.url,true).query;
    console.log('姓名；${user.name}--年龄:${user.age}');
    
    }

    res.writeHead(200,{"Content-type":"text/html;charset=utf-8"});
    res.write('this is nodejs');//write输出
    res.end('holle,worde');
}).listen(3000)//127,0,0,1:3000本地连接的3000端口


